/*
 * Copyright (C) 2018 Baidu, Inc. All Rights Reserved.
 */
package com.bootdo.hjh.vo;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.bootdo.hjh.domain.OrderDO;

public class OrderAdminVO {
    private Integer id;

    private String orderNo;

    private String orderTitle;

    private Long userId;

    private String username;

    private Byte orderStatus;

    private Integer productId;

    private String title;

    private String amount;

    private String cancelTime;

    private String expirationTime;

    private String province;

    private String city;

    private String district;

    private Integer postcode;

    private String address;

    private String tel;

    private String mobile;

    private String payChannel;

    private Integer shippingChannel;

    private String shiippingSn;

    private String shippingTime;

    private String shippingFinishTime;

    private String createTime;

    private String lastModifyTime;

    private Long createUserId;

    private Integer quantity;

    private String salePrice;

    private String receiver;

    private Long payUserId;

    private String payUserName;

    private Integer isFr;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getOrderTitle() {
        return orderTitle;
    }

    public void setOrderTitle(String orderTitle) {
        this.orderTitle = orderTitle;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Byte getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Byte orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getCancelTime() {
        return cancelTime;
    }

    public void setCancelTime(String cancelTime) {
        this.cancelTime = cancelTime;
    }

    public String getExpirationTime() {
        return expirationTime;
    }

    public void setExpirationTime(String expirationTime) {
        this.expirationTime = expirationTime;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public Integer getPostcode() {
        return postcode;
    }

    public void setPostcode(Integer postcode) {
        this.postcode = postcode;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(String payChannel) {
        this.payChannel = payChannel;
    }

    public Integer getShippingChannel() {
        return shippingChannel;
    }

    public void setShippingChannel(Integer shippingChannel) {
        this.shippingChannel = shippingChannel;
    }

    public String getShiippingSn() {
        return shiippingSn;
    }

    public void setShiippingSn(String shiippingSn) {
        this.shiippingSn = shiippingSn;
    }

    public String getShippingTime() {
        return shippingTime;
    }

    public void setShippingTime(String shippingTime) {
        this.shippingTime = shippingTime;
    }

    public String getShippingFinishTime() {
        return shippingFinishTime;
    }

    public void setShippingFinishTime(String shippingFinishTime) {
        this.shippingFinishTime = shippingFinishTime;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getLastModifyTime() {
        return lastModifyTime;
    }

    public void setLastModifyTime(String lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public String getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(String salePrice) {
        this.salePrice = salePrice;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public Long getPayUserId() {
        return payUserId;
    }

    public void setPayUserId(Long payUserId) {
        this.payUserId = payUserId;
    }

    public String getPayUserName() {
        return payUserName;
    }

    public void setPayUserName(String payUserName) {
        this.payUserName = payUserName;
    }

    public Integer getIsFr() {
        return isFr;
    }

    public void setIsFr(Integer isFr) {
        this.isFr = isFr;
    }

    public OrderAdminVO copyFrom(OrderDO orderDO){
        this.id = orderDO.getId();
        this.orderNo = orderDO.getOrderNo();
        this.orderTitle = orderDO.getOrderTitle();
        this.userId = orderDO.getUserId();
//        this.username = orderDO.getUsername();
        this.orderStatus = orderDO.getOrderStatus();
        this.productId = orderDO.getProductId();
        this.title = orderDO.getTitle();
        if(orderDO.getAmount()!=null && orderDO.getAmount()!=0){
            amount = new java.text.DecimalFormat("#.00").format(orderDO.getAmount()/100.0);
        }else{
            amount = "0.00";
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if(orderDO.getCancelTime()!=null){
            this.cancelTime = sdf.format(orderDO.getCancelTime());
        }
        if(orderDO.getExpirationTime()!=null){
            this.expirationTime = sdf.format(orderDO.getExpirationTime());
        }
        this.province = orderDO.getProvince();
        this.city = orderDO.getCity();
        this.district = orderDO.getDistrict();
        this.postcode = orderDO.getPostcode();
        this.address = orderDO.getAddress();
        this.tel = orderDO.getTel();
        this.mobile = orderDO.getMobile();
        this.payChannel = orderDO.getPayChannel();
        this.shippingChannel = orderDO.getShippingChannel();
        this.shiippingSn = orderDO.getShiippingSn();
        if(orderDO.getShippingTime()!=null){
            this.shippingTime = sdf.format(orderDO.getShippingTime());
        }
        if(orderDO.getShippingFinishTime()!=null){
            this.shippingFinishTime = sdf.format(orderDO.getShippingFinishTime());
        }
        if(orderDO.getCreateTime()!=null){
            this.createTime = sdf.format(orderDO.getCreateTime());
        }
        if(orderDO.getLastModifyTime()!=null){
            this.lastModifyTime = sdf.format(orderDO.getLastModifyTime());
        }
        this.createUserId = orderDO.getCreateUserId();
        this.quantity = orderDO.getQuantity();
        if(orderDO.getSalePrice()!=null && orderDO.getSalePrice()!=0){
            salePrice = new java.text.DecimalFormat("#.00").format(orderDO.getSalePrice()/100.0);
        }else{
            salePrice = "0.00";
        }
        this.receiver = orderDO.getReceiver();
        this.payUserId = orderDO.getPayUserId();
        this.payUserName = orderDO.getPayUserName();
        this.isFr = orderDO.getIsFr();
        return this;
    }
}
